#include<bits/stdc++.h>
#define int long long
#define N 200010
using namespace std;
int n,a[N],ans;
signed main()
{
	freopen("color.in","r",stdin);
	freopen("color.out","w",stdout);
	scanf("%lld",&n);
	for(int i=1;i<=n;++i) scanf("%lld",a+i);
	sort(a+1,a+n+1);
	for(int i=2;i<=n;++i) ans+=(a[i]==a[i-1]?1:0);
	printf("%lld",ans-1);
	return 0;
}
